package org.cars.designPatterns.patterns.AbstractFactory.producer;

import org.cars.designPatterns.patterns.AbstractFactory.factory.AbstractFactory;
import org.cars.designPatterns.patterns.AbstractFactory.factory.impl.ColorFactory;
import org.cars.designPatterns.patterns.AbstractFactory.factory.impl.ShapeFactory;

/**
 * @author caoqianfan
 * @date 2024/5/20 下午5:31
 */
public class FactoryProducer {
    public static AbstractFactory getFactory(String choice){
        if(choice.equalsIgnoreCase("SHAPE")){
            return new ShapeFactory();
        } else if(choice.equalsIgnoreCase("COLOR")){
            return new ColorFactory();
        }
        return null;
    }
}